'use strict';

export class MethodList {

    constructor() {
        //服务器接口信息
        this.methodList = {
            version: "apiInfo.version",
            //用户相关
            user: {
                login: "User.Login",
                get:"User.Get",
                setField:"User.SetField",
            },
            mqtt:{
                "SubList":"Mqtt.SubList",
                "Pub":"Mqtt.Pub",
            }
        }
    }

    Get(v) {
        let MethodStr = "";
        switch (v) {
            case 'version': //获取版本
                MethodStr = this.methodList.version;
                break;
            /**
             * 获取用户信息
             */
            case 'UserLogin': //用户登录
                MethodStr = this.methodList.user.login;
                break;
            case 'UserGet': //用户登录
                MethodStr = this.methodList.user.get;
                break;
            case 'UserSetField': //设置某用户选项
                MethodStr = this.methodList.user.setField;
                break;
            case'MqttSubList':{
                MethodStr = this.methodList.mqtt.SubList;
                break
            }
            case'MqttPub':{
                MethodStr = this.methodList.mqtt.Pub;
                break
            }

        }
        return MethodStr
    }
}
